st = "hello world"
for i in st:
    print(i)

for i in range(5):
    print(i)

for i in range(1,10):
    print(i)

for i in range(1,10,2):
    print(i)

# 当循环正常结束，没有执行break则会执行else块的代码。应用于循环体内没有达到预期目标的情况下。在else块中处理
for i in range(1,10):
    print(f"找到了{i}个鬼")
    if i == 3:
        break
else:
    print("所有鬼都找到了")